package com.hnas.ecard.web;

import java.util.ArrayList;
import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;

import com.hnas.core.dto.DTOPagedList;
import com.hnas.core.dto.DataBean;
import com.hnas.ecard.service.AccChannelReService;
import com.hnas.ecard.service.dto.DTOAccChannelRe;
import com.hnas.ecard.service.search.DTOEAccChannelReSearch;

@Controller
@RequestMapping("/backend/acc_channel")
public class AccChannelController {

	@Autowired
	private AccChannelReService accChannelReService;
	
	@RequestMapping("/search")
	public String search(ModelMap modelMap,HttpServletRequest request,HttpServletResponse response,@ModelAttribute("criteria")DTOEAccChannelReSearch criteria) {
		criteria.setTotalCount(-1);
		DTOPagedList<DTOAccChannelRe> pg = this.accChannelReService.page(criteria);
		modelMap.put("pg", pg);
		modelMap.put("dto", criteria);
		
		List<DataBean> beans = new ArrayList<DataBean>();
		beans.add(new DataBean("accId","accId","账户编号",false,150,0));
		beans.add(new DataBean("accName","accName","账户名称",false,150,0));
		beans.add(new DataBean("phoneNo","phoneNo","手机号",false,150,0));
		beans.add(new DataBean("channelCode","channelCode","渠道编号",false,150,0));
		beans.add(new DataBean("channelName","channelName","渠道名称",false,150,0));
		modelMap.put("beans", beans);
		return "/backend/ecard/list_acc_channel";
	}
}
